package com.gitee.sop.notify.schedule;

import com.gitee.sop.notify.service.NotifyBizService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @author 六如
 */
@Component
public class NotifySchedule {

    @Autowired
    private NotifyBizService notifyBizService;

    /**
     * 每分钟执行一次
     */
    @Scheduled(cron = "0 0/1 * * * ?")
    public void run() {
        notifyBizService.retry(LocalDateTime.now());
    }

}
